<%@ page contentType="text/html; charset=utf-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户登录</title>

	<link href="css/login.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="jquery/jquery-1.8.3.min.js"></script>



</head>
<body id="userlogin_body">

<div id="user_login">
	<dl>
		<dd id="user_top">
			<ul>
				<li class="user_top_l"></li>
				<li class="user_top_c"></li>
				<li class="user_top_r"></li>
			</ul>
		</dd>
		<span  <%--action="/login" method="post"--%>>
			<dd id="user_main">
				<ul>
					<li class="user_main_l"></li>
					<li class="user_main_c">
						<div class="user_main_box">
							<ul>
								<li class="user_main_text">用户名： </li>
								<li class="user_main_input"><input  maxlength="20" name="loginNumber"  id="TxtUserName" class="txtusernamecssclass"> </li>
							</ul>
							<ul>
								<li class="user_main_text">密 码： </li>
								<li class="user_main_input"><input type="password" name="password" id="TxtPassword" class="txtpasswordcssclass"> </li>
							</ul>
							<ul>
								<li class="user_main_text">Cookie： </li>
								<li class="user_main_input"><select name="DropExpiration" id="DropExpiration">
									<option selected="" value="None">不保存</option> <option value="Day">保存一天</option>
									<option value="Month">保存一月</option> <option value="Year">保存一年</option></select> </li>
							</ul>
						</div>
					</li>
					<li class="user_main_r">
						<a >
							<input type="image" name="IbtnEnter" id="sub" src="img/user_botton.gif"  class="ibtnentercssclass">
						</a>
					</li>
				</ul>
			</dd>
		</span>

		<dd id="user_bottom">
			<ul>
				<li class="user_bottom_l"></li>
				<li class="user_bottom_c"></li>
				<li class="user_bottom_r"></li>
			</ul>
		</dd>
	</dl>
</div>

<script type="text/javascript">

		$(function () {
			$("#sub").click(function () {
				var loginNumber=$("[name='loginNumber']").val();
				var password=$("[name='password']").val();
				if (loginNumber==null){
					alert("用户名不能为空!")
				}else if(password==null) {
					alert("密码不能为空!")
				}else {
					/*alert(loginNumber+":"+password)*/
					$.ajax({
						url:"/login",
						data:{loginNumber:loginNumber,password:password},
						type:"post",
						dataType:"text",
						success:function (re) {
							console.log(re);
							if (re!=false){
								alert("用户名或密码错误");
							}else {
								location.href="${pageContext.request.contextPath}/index.jsp"
							}
						}
					})
				}

			})
		})




</script>
</body>
</html>